package com.dyw.ssmp.utils;

import com.dyw.ssmp.result.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author Devil
 * @create 2022-01-24-18:16
 */
@SuppressWarnings("all")
//作为springmvc异常处理
@RestControllerAdvice
public class ProjectExceptionAdvice {
    //拦截所有的异常信息
    @ExceptionHandler
    public Result doException(Exception ex){
        //记录日志
        //通知运维
        //通知开发
        return new Result("服务器故障,请稍后再试");
    }
}
